import {
	IGridAbility,
	IGridExpBarAbility,
	IGridExpBarController,
	IGridExpBarControllerParams,
	IGridExpBarStore,
	GridExpBarActionType,
} from '@/core/interface';
import { ExpCtrlController } from './exp-ctrl-controller';

/**
 * 树导航栏控制器
 *
 * @export
 * @class GridExpBarController
 * @extends {ExpCtrlController<GridExpBarActionType, IGridExpBarStore, IGridExpBarAbility>}
 * @implements {IGridExpBarController<IGridExpBarStore, IGridExpBarAbility>}
 */
export class GridExpBarController
	extends ExpCtrlController<
		GridExpBarActionType,
		IGridExpBarStore,
		IGridExpBarAbility
	>
	implements IGridExpBarController<IGridExpBarStore, IGridExpBarAbility>
{
	/**
	 * Creates an instance of GridExpBarController.
	 * @param {IGridExpBarControllerParams<GridExpBarActionType,IGridExpBarAbility>} params
	 * @memberof GridExpBarController
	 */
	public constructor(
		params: IGridExpBarControllerParams<
			GridExpBarActionType,
			IGridExpBarAbility
		>
	) {
		super(params);
		this.ctrlInit(params);
	}

	/**
	 * 处理部件初始化
	 *
	 * @protected
	 * @param {IGridExpBarControllerParams<GridExpBarActionType,IGridExpBarAbility>} params
	 * @memberof GridExpBarController
	 */
	protected processCtrlInit(
		params: IGridExpBarControllerParams<
			GridExpBarActionType,
			IGridExpBarAbility
		>
	) {
		super.processCtrlInit(params);
		Object.assign(this.store, { selection: {} });
	}
}
